// import Vue from 'vue'
import { axios } from '@/utils/request'

// post method= {post | put}
export function httpAction(url, parameter, method) {
  return axios({
    url: url,
    method: method,
    data: parameter,
  })
}

// POST请求
export function postAction(url, parameter) {
  return axios({
    url: url,
    method: 'post',
    data: parameter,
  })
}

// PUT请求
export function putAction(url, parameter) {
  return axios({
    url: url,
    method: 'put',
    data: parameter,
  })
}

// GET请求
export function getAction(url, parameter) {
  return axios({
    url: url,
    method: 'get',
    params: parameter,
  })
}

// Delete 请求
export function deleteAction(url, parameter) {
  return axios({
    url: url,
    method: 'delete',
    params: parameter,
  })
}
